package tech.aistar.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tech.aistar.entity.Quiz;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: shuaiguo
 * @Date: 2020/10/01/16:36
 * @Description:
 */
public interface  QuizMapper {
    @Select("select * from quiz")
    List<Quiz> selectAll();


    @Insert("insert into quiz values(quizContent,checkState,thumpUpNumber,releaseTime,updateTime,tenantId,houseId)")
    void insert(Quiz quiz);
    @Update("update quiz set quiz_content=#{quizContent},check_state=#{checkState}" +
            ",thump_up_number=#{thumpUpNumber},release_time=#{releaseTime},update_time=#{updateTime}" +
            ",tenant_id=#{tenantId},house_id=#{houseId} where id=#{Id}")
    void  updateByPrimaryKey(Quiz quiz);

    @Delete("delete from quiz where id=#{id}")
    void deleteByPrimaryKey(Integer id);

}
